from django.db import models
# from django.utils.timezone import now

# Create your models here.


class ToolClasses(models.Model):
    classname = models.CharField(max_length=50, verbose_name='类别名称')


class Cards(models.Model):

    choice_star = ((1, "金"), (2, "紫"), (3, "蓝"))
    choice_up = ((1, "up"), (2, "非up"))
    baby_choice = ((1, "角色"), (2, "武器"))

    name = models.CharField(max_length=20, verbose_name="名称")
    classes = models.IntegerField(choices=baby_choice, verbose_name="类型")
    stars = models.IntegerField(choices=choice_star, verbose_name="星级")
    up = models.IntegerField(choices=choice_up, verbose_name="up", null=True)

    def __repr__(self):
        return self.name


class UserCards(models.Model):

    card_name = models.ForeignKey(Cards, on_delete=models.CASCADE)
    card_num = models.IntegerField(default=0)
    date = models.DateTimeField(auto_now=True)


class CardsNum(models.Model):

    choice_ground = ((1, "Y"), (2, "N"))
    ground = models.IntegerField(choices=choice_ground, default=2, verbose_name="保底")
    nums = models.IntegerField(default=0)

